﻿KindEditor.ready(function (K) {
    window.KE = K;
});
function SyncEditor() {
    window.editor.sync();
    var textarea = document.querySelector("textarea.el-input__inner");
    return textarea.value;
}
function ClearEditor() {
    window.editor.remove("textarea");
}
function registerHtmlEditor(editor) {
    if (!editor) {
        console.log("editor not found");
        return;
    }
    console.dir(editor);
    window.editor = KE.create("textarea", {
        width: 820,
        height: 300,
        items: ['undo', 'redo', '|', 'preview', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
            'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', 'table', 'hr', 'pagebreak',
            'anchor', 'link', 'unlink'
        ]
    });
    console.log(window.editor);
}